

package com.xtsoft.platform.task.domain;

/*
*    上海信拓信息技术有限公司  
*    Copyright (C) ShangHai XinTuo Software Inc.
*/

import org.apache.commons.lang3.builder.ToStringBuilder;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import lombok.Data;

import com.xtsoft.core.entity.GenericEntity;

/**
 * SchedulerTask Base Java Bean, base class for the model, mapped directly to database table
 * 
 * Avoid changing this file if not necessary, will be overwritten. 
 *
 * TODO: add class/table comments
 */
@Entity
@Table(name = "scheduler_task")
@Data
public class SchedulerTask extends GenericEntity {


	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(name="schedulerTaskId",nullable=false,length=32)
    private String schedulerTaskId;


	/**
	*   名称
	*/
		@Column(name="name",nullable=false, length=64 )
	private String name;


	/**
	*   类名
	*/
		@Column(name="className",nullable=false, length=64 )
	private String className;


	/**
	*   Cron表达式
	*/
		@Column(name="cron",nullable=false, length=64 )
	private String cron;


	/**
	*   Cron表达式说明
	*/
		@Column(name="cronDescript",nullable=false, length=128 )
	private String cronDescript;


	/**
	*   状态
	*/
		@Column(name="state",nullable=false, length=10 )
	private Integer state;


	/**
	*   说明
	*/
		@Column(name="descript",nullable=false, length=255 )
	private String descript;



	/**
	*  默认构造
	*/
	public SchedulerTask(){
	
	}

	/**
	*  构造方法，自动测试使用，把除主键外的所有非空字段赋值
	*
	*  也可作普通使用  调用该构造方法时，字串参数填或不填均
	*  可，该带参构造方法仅为区别Lombok自动生成的默认构造方
	*  法。
	*  
	*  应用程序可根据需要修改该构造方法中的非空属性赋值。删了
	**/


	/**
	 * @see Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this)
				.append("schedulerTaskId", this.schedulerTaskId) 
				.append("name", this.name) 
				.append("className", this.className) 
				.append("cron", this.cron) 
				.append("cronDescript", this.cronDescript) 
				.append("state", this.state) 
				.append("descript", this.descript) 
				.toString();
	}
	
	/**
	 * 以实体类主键生成HASHCODE
	 */
	@Override  
	public int hashCode() {  
	    return this.schedulerTaskId.hashCode();  
	} 	 
	
	/**
	 * 以实体类主键比较对象是否相等
	 */
	@Override  
	public boolean equals(Object obj) {  
	    if (obj instanceof SchedulerTask) {  
	        return this.schedulerTaskId.equals(((SchedulerTask) obj).getSchedulerTaskId());  
	    }  
	    return false;  
	}	 
	
}
